package com.mvu.banana.common.widget;

import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.ListBox;
import com.mvu.banana.common.client.SystemConstants;

/**
 */
public class GWTUtil implements SystemConstants{
  public static String getLoginAction(){
    return LOGIN_ACTION + Window.Location.getQueryString();
  }

  public static void initListBox(ListBox listBox, String name, String nullValue, int begin, int end) {
    listBox.addItem(name, nullValue);
    int i = begin;
    do{
      listBox.addItem(String.valueOf(i), String.valueOf(i));
      i = begin < end ? i+1 : i-1;
    }while (i != end);
  }
}
